{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(\n",
    "    {'City': ['Buenos Aires', 'Brasilia', 'Santiago', 'Bogota', 'Caracas'],\n",
    "     'Country': ['Argentina', 'Brazil', 'Chile', 'Colombia', 'Venezuela'],\n",
    "     'Latitude': [-34.58, -15.78, -33.45, 4.60, 10.48],\n",
    "     'Longitude': [-58.66, -47.91, -70.66, -74.08, -66.86]})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "config = {\n",
    "    \"version\": \"v1\",\n",
    "    \"config\": {\n",
    "        \"visState\": {\n",
    "            \"layers\": [\n",
    "                {\n",
    "                    \"type\": \"point\",\n",
    "                    \"config\": {\n",
    "                        \"dataId\": \"city\",\n",
    "                        \"isVisible\": True,\n",
    "                        \"columns\": {\n",
    "                            \"altitude\": None,\n",
    "                            \"lat\": \"Latitude\",\n",
    "                            \"lng\": \"Longitude\"\n",
    "                        },\n",
    "                        \"color\": [165, 16, 55],\n",
    "                        \"visConfig\": {\n",
    "                            \"radius\": 64.4\n",
    "                        },\n",
    "                        \"textLabel\": {\n",
    "                            \"field\": {\"name\": \"City\", \"type\": \"string\"}\n",
    "                        }\n",
    "                    }\n",
    "                }\n",
    "            ]\n",
    "        }\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Documentation: https://github.com/keplergl/kepler.gl/blob/master/docs/keplergl-jupyter/user-guide.md\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "080206beed784d8e9141bace7468f9ae",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "S2VwbGVyR2woY29uZmlnPXsndmVyc2lvbic6ICd2MScsICdjb25maWcnOiB7J3Zpc1N0YXRlJzogeydsYXllcnMnOiBbeydjb25maWcnOiB7J2RhdGFJZCc6ICdjaXR5JywgJ2NvbG9yJzogWzHigKY=\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import keplergl\n",
    "w1 = keplergl.KeplerGl(height=500, data={\"city\": df}, config=config)\n",
    "w1"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
